home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscAppIconAnimator.h < prev    next >
Encoding:
Text File  |  1996-02-12  |  3.2 KB  |  90 lines

  1. //
  2. //    MiscAppIconAnimator.h -- This is an Object to animate the icon
  3. //                for an application.  This Object will allow
  4. //                similiar activity to NeXTMail when new mail arrives.
  5. //        Written by Craig Laurent Copyright 1995 by Craig Laurent.
  6. //                Version 1.0.  All rights reserved.
  7. //
  8. //        This notice may not be removed from this source code.
  9. //
  10. //    This object is included in the MiscKit by permission from the author
  11. //    and its use is governed by the MiscKit license, found in the file
  12. //    "License.rtf" in the MiscKit distribution.  Please refer to that file
  13. //    for a list of all applicable permissions and restrictions.
  14. //    
  15. #import <appkit/appkit.h>
  16.  
  17.  
  18. /* MiscAppIconAnimator. - an Object to animate the icon for an application.  This Object will allow similiar activity to NeXTMail when new mail arrives.  Pass in an List of NXImages, an List of integers indicating the pattern, and the number of loops through the pattern to execute.  The time interval between image changes, and the stopAnimation icon can be set after initialization.
  19.  
  20. imageArray - an List of NXImages to be placed in the icon one at a time.
  21. animationPattern - an List of integers.  Each number indicates which image number (objectAt:) should be displayed.  The order of the numbers will reflect the pattern of the animation.
  22. patternLoops - the number of times that the animationPattern will be looped through.
  23. timeInterval - the time interval between image changes.  Defaults to 0.2 seconds.  See setTimeInterval: method.
  24. indexOfEndIcon - the index of the icon to be displayed at the end of the animation cycle.  Defaults to 1.  See setIndexOfEndIcon: method.
  25. indexOfStopIcon - the index of the icon to be displayed after stopAnimation:.  Defaults to 0.  See setIndexOfStopIcon: method.
  26. */
  27.  
  28. @interface MiscAppIconAnimator:Object
  29. {
  30.     NXImage    *appTile;
  31.     View    *appIconContentView;
  32.  
  33.     List    *animationPattern;
  34.     List    *imageArray;
  35.     int    patternLoops;
  36.     float    timeInterval;
  37.     int    indexOfEndIcon;
  38.     int    indexOfStopIcon;
  39.  
  40.     DPSTimedEntry    timedEntry;
  41.     int    patternIterator;
  42.     int    loopCount;
  43.     int    patternEnd;
  44.     int    offset;
  45. }
  46.  
  47. void MiscAppIconAnimate (DPSTimedEntry timedEntry, double  now, void *who);
  48.  
  49. - init;
  50. - initWithImageArray:(List*)anArray animationPattern:(List*)patternArray andPatternLoops:(int)loops;    //designated initializer
  51. - free;
  52.  
  53. //** instance methods
  54. - (List*)imageArray;
  55. - (void)setImageArray:(List*)anArray;
  56. - (List*)animationPattern;
  57. - (void)setAnimationPattern:(List*)anArray;
  58. - (int)patternLoops;
  59. - (void)setPatternLoops:(int)numLoops;
  60. - (float)timeInterval;
  61. - (void)setTimeInterval:(float)interval;
  62. - (int)indexOfEndIcon;
  63. - (void)setIndexOfEndIcon:(int)endIcon;
  64. - (int)indexOfStopIcon;
  65. - (void)setIndexOfStopIcon:(int)stopIcon;
  66.  
  67. //** methods to change Animation
  68. - (void)startAnimation:sender;
  69. - (void)stopAnimation;
  70.  
  71.  
  72. //** Internal methods
  73. - (void)removeTimedEntry;
  74. - (NXPoint)cornerPointForImage:(NXImage*)anImage;
  75. - (void)displayImage:(NXImage*)anImage;
  76. - (void)displayImageAtIndex:(int)imageNum;
  77. - (void)animateIcon;
  78.  
  79.  
  80. //** archiving methods
  81. - write:(NXTypedStream *)stream;
  82. - read:(NXTypedStream *)stream;
  83.  
  84. //** Distributed Object methods
  85. - encodeRemotelyFor:(NXConnection *)connection freeAfterEncoding:(BOOL *)flagp isBycopy:(BOOL)isBycopy;
  86. - encodeUsing:(id <NXEncoding>)portal;
  87. - decodeUsing:(id <NXDecoding>)portal;
  88.  
  89. @end
  90.